﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DomainDriver.DomainModeling.Events;

namespace DomainDriver.DomainModeling.DomainModels
{
    public enum InvalidCallAction
    {
        Ignore,
        ThrowException
    }

    public interface IBatchPersistableDomainModel : IDomainModel
    {
        event ChangingDataSourceDelegate LoadingFromDataSource;
        event ChangedDataSourceDelegate LoadedFromDataSource;
        event ChangingDataSourceDelegate PersistingToDataSource;
        event ChangedDataSourceDelegate PersistedToDataSource;

        InvalidCallAction InvalidCallAction { get; }

        void LoadFromDataSource<DATASOURCE>(DATASOURCE dataSource);
        void PersistToDataSource<DATASOURCE>(DATASOURCE dataSource);
    }

    public interface IBatchPersistableDomainModel<DATASOURCE> : IBatchPersistableDomainModel
    {
        void LoadFromDataSource(DATASOURCE dataSource);
        void PersistToDataSource(DATASOURCE dataSource);
    }
}